package ru.niir.goodfil.audit.ui.extractors;

import ru.niir.goodfil.audit.domain.OrderItemUIEvent;
import ru.niir.goodfil.audit.domain.PersonalPriceEvent;
import ru.niir.goodfil.excel.client.ValueExtractor;

/**
 * @author: Кирилл
 */
public class EventPriceExtractor implements ValueExtractor {
    public Object extract(Object o) {
        if (o instanceof PersonalPriceEvent) {
            return ((PersonalPriceEvent) o).getPrice();
        }

        if (o instanceof OrderItemUIEvent) {
            return ((OrderItemUIEvent) o).getPrice();
        }

        return "";
    }
}
